

GameObjectCompant::GameObjectCompant(const char* compantname, const char* spritename, CCLayer *parent){
  normalSpriteName_ = spritename;
  compantName_ = compantname;
  sprite_ = CCSprite::createWithSpriteFrameName(spritename);
  parent->addChild(sprite_);
}

void GameObjectCompant::setSprite(const char* spritename){
  CCSprite * sp = CCSprite::createWithSpriteFrameName(spritename);
  CCPoint p = ccp(0,9);
  if(sprite_){
    parent_->removeChild(sprite_, true);
    p = sprite_->getPosition();
  }
  sp->setPosition(p);
  parent->addChild(sp);
  sprite_ = sp;
  normalSpriteName_ = spritename;
}
